package org.example.campus_sys_backend.controller;

import org.example.campus_sys_backend.model.UnitInfo;
import org.example.campus_sys_backend.service.UnitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/unit")
public class UnitController {
    @Autowired
    public UnitService unitService;
@RequestMapping("/add")
    public Boolean addUnit(UnitInfo unitInfo){
        if (unitInfo != null){
            unitService.insertUnit(unitInfo);
            return true;

        }
        System.out.println("传入参数不合法");
        return false;
    }
}
